package com.miyuan.wm.utils;

import org.apache.shiro.crypto.hash.SimpleHash;

public class ShiroMD5 {

	// 加密方式
	private final static String HASHMODE = "Md5";
	// 加密次数
	private final static int SALTNUM = 1024;

	public static String shiroMD5(String pwd) {
		String hashAlgorithmName = HASHMODE;
		Object credentials = pwd;
		int hashIterations = SALTNUM;
		Object result = new SimpleHash(hashAlgorithmName, credentials, null, hashIterations);
		return result.toString();
	}

	public static void main(String[] args) {
		System.out.println(shiroMD5("admin123"));
	}

}
